﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MyHotel
{
    public class StateRoomManager
    {
        StateRoom[] _staterooms;
        int _nState;

        public StateRoomManager()
        {
            _nState = 2;
            _staterooms = new StateRoom[_nState];
            _staterooms[0] = new RoomStateHiring();
            _staterooms[1] = new RoomStateBlank(); 
        }

        public StateRoom CreateStateRoom(String strState)
        {
            StateRoom stt = null;
            foreach (StateRoom state in _staterooms)
            {
                if (state.getNameState().Equals(strState))
                {
                    stt = state.Clone();
                    break;
                }
            }

            return stt;
        }
    }
}
